// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取菜单规则列表 */
export async function getMenurule(
  params: API.RuleListItem & API.PageParams,
  options?: { [key: string]: any },
) {
  return request<API.RuleList>('/system/auth_rule/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 新增菜单 */
export async function addItem(data: {}, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/system/auth_rule/add', {
    data,
    method: 'post',
    ...(options || {}),
  });
}

/** 编辑菜单 */
export async function updateItem(data: {}, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/system/auth_rule/edit', {
    data,
    method: 'post',
    ...(options || {}),
  });
}

/** 删除菜单 */
export async function removeItem(data: {}, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/system/auth_rule/delete', {
    data,
    method: 'post',
    ...(options || {}),
  });
}
